<%--
  Created by IntelliJ IDEA.
  User: Root404
  Date: 2022/7/8
  Time: 14:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>欢迎来到登录页面</h1>
请输入内容<input type="text" id="text">
<input type="button" value="点我异步查询" id="bt">
<ul></ul>
<script src="${pageContext.request.contextPath}/statics/js/jquery.js"></script>
<script>
    $("#bt").css("background-color","red");
$("#bt").click(function () {
    var text=$("#text").val();
    $("ul").html(" ");
    $.getJSON("${pageContext.request.contextPath}/findAjax?name="+text,
    function (data) {
        $.each(data,function () {
            var li="<li>"+this.name+"</li>";
            $("ul").append(li);
        })
    });
});
</script>
</body>
</html>
